package com.norteksoft.erm.model;

import org.apache.commons.lang.builder.HashCodeBuilder;

public class Right extends BaseObject {

	private static final long serialVersionUID = -7456117897290626190L;

	public Long rightID = new Long(-1);

	public Operation operation;

	public String inheritable;// 继承标记

	public int hashCode() {
		return new HashCodeBuilder().append(rightID).append(operation).append(
				inheritable).toHashCode();
	}

	public Right() {
	}

	/**
	 * @hibernate.id generator-class="sequence" column="RIGHTID"
	 *               unsaved-value="-1" type="long"
	 * @hibernate.generator-param name="sequence" value="ERM_SEQUENCE_FREQUENT"
	 */

	public Long getRightID() {
		return rightID;
	}

	public void setRightID(Long rightID) {
		this.rightID = rightID;
	}

	/**
	 * @hibernate.component name="operation" insert="true" update="true"
	 */
	public Operation getOperation() {
		return operation;
	}

	public void setOperation(Operation operation) {
		this.operation = operation;
	}

	/**
	 * @hibernate.property name="inheritable" column="INHERITABLE" type="char"
	 */
	public String getInheritable() {
		return inheritable;
	}

	public void setInheritable(String inheritable) {
		this.inheritable = inheritable;
	}

	public boolean beInheritable() {
		if (this.inheritable != null) {
			return "Y".equals(inheritable);
		} else {
			return false;
		}
	}
}
